SET.EXTERNAL_RECORD_CONTENT_GET Function

Syntax

C set.external_record_content_get(C setname ,C content_expression [,C order [,C filter [,N level ]]])

Arguments

setname

The name of the set.

content_expression

An expression that defines the fields to return.

order

Optional. Default = record order. A character order expression that sorts selected records. You can only sort on fields from the primary table and any tables that are linked to the primary table with a one-to-one link.

filter

Optional. Default = ".T." (All records). A character filter expression that evaluates to a logical value and selects records from the set.

level

Optional. Default = 0. Used when fetching through the records of a set. The level determines the depth of the fetch, so that tables at lower levels in the set can be excluded from the Fetch operation.

0 = Fetch through all of the one-to-many links.
1 = Fetch only through primary table records, meaning that the method will return data from any primary table fields, and tables linked to the primary table one-to-one.
2 = Fetch through primary table records, and records in the child one-to-many links.
3 = Fetches through primary, child and grand-child one-to-many links

Description

Extacts data from a set in a cr-lf delimited string

Discussion

The SET.EXTERNAL_RECORD_CONTENT_GET() method returns records from a set.

Example

In this example, we extract data from the Invoice.set in Alphasports. Since the level is not specified, Alpha Anywhere extracts data from all of the child records in the one-to-many links.

? set.external_record_content_get("invoice.set", "invoice_number +' ' +
product->description", "invoice_number")
= 000001 SIP Binoculars
000001 TrueNorth Compass
000001 EuroPal Pocket Knife
000001 Reeler's 40 # Fishing Line 200'
000001 Fast Trak Cross Trainers (Women)
000001 Arctic Trek Dome Tent
000002 Alpha Sports Cap
000002 Slazinger Cricket Bat
000003 Techelon Hybrid Racquet

In this example, the level is set to 1 so Alpha Anywhere only fetches through primary table records.

? set.external_record_content_get("invoice.set", "invoice_number +' ' +
customer->lastname", "invoice_number", "", 1)
= 000001 Fuller
000002 Rigan
000003 Mesner
000004 Feld
000005 Eagle

This example is same as Prior one, but the level is set to 0. Notice that since is fetching through the one-many link, there ?appears' to be duplicate records.

? set.external_record_content_get("invoice.set", "invoice_number +' ' +
customer->lastname", "invoice_number", "", 0)
= 000001 Fuller
000001 Fuller
000001 Fuller
000001 Fuller
000001 Fuller
000001 Fuller
000002 Rigan
000002 Rigan
000003 Mesner
000003 Mesner

By adding in a field from the one-many child link, you see that Alpha Anywhere was not really returning duplicate records.

? set.external_record_content_get("invoice.set", "invoice_number +' ' +
customer->lastname + ' ' + product->description", "invoice_number", "", 0)
= 000001 Fuller SIP Binoculars
000001 Fuller TrueNorth Compass
000001 Fuller EuroPal Pocket Knife
000001 Fuller Reeler's 40 # Fishing Line 200'
000001 Fuller Fast Trak Cross Trainers (Women)
000001 Fuller Arctic Trek Dome Tent
000002 Rigan Alpha Sports Cap
000002 Rigan Slazinger Cricket Bat
000003 Mesner Techelon Hybrid Racquet
000003 Mesner Reeler's 40 # Fishing Line 200'

See Also